package ${packageValue}.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.yupaits.yutool.commons.util.ValidateUtils;
import com.yupaits.yutool.commons.extension.checker.params.ParamsCheckProcedure;
import com.yupaits.yutool.orm.core.base.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
<#if (imports?size > 0)>
	<#list imports as typeImport>
import ${typeImport};
    </#list>
</#if>

/**
 * ${comment}Dto对象
 * @author ${author}
 * @since ${date}
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class ${entityName}Dto extends BaseDto<Long, ${entityName}Dto> {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @ExcelProperty(value = "ID")
    private Long id;

    <#if (fields?size > 0)>
        <#list fields as field>
            <#if !field.nullable>
    /**
     * ${field.comment}
     * @required
     */
            <#else>
    /**
     * ${field.comment}
     */
            </#if>
    @ExcelProperty(value = "${field.comment}")
    private ${field.fieldType} ${field.fieldObj};

        </#list>
    </#if>
    @Override
    public void checkValid() {
        ParamsCheckProcedure.procedure()
                .add(id != null && !ValidateUtils.idValid(id), "无效的${comment}ID")
                <#if (fields?size > 0)>
                    <#list fields as field>
                        <#if !field.nullable>
                .add(${field.fieldObj} == null, "${field.comment}不能为空")
                        </#if>	
                    </#list>
                </#if>
                .check();
    }
}